import request from '@/utils/request'
// 封装获取面经列表的接口,传递的数据放在请求头中,所以用params,axiox.method('url',根据文档确定第二个参数是数据还是配置项)
export const getArticleList = (data) =>
  request.get('/admin/interview/query', { params: data })
// 封装面经创建接口
export const createArticle = (data) =>
  request.post('/admin/interview/create', data)
// 封装删除面经接口,传递的数据放在请求体中,所以用data
export const delArticle = (id) =>
  request.delete('/admin/interview/remove', { data: { id } })
// 获取单个面经详情
export const getArticleDetail = (id) =>
  request.get('/admin/interview/show', { params: { id } })
// 更新面经数据,post 与 put 传参一致
export const updateArticle = (data) =>
  request.put('/admin/interview/update', data)
//
//
//
//
// 区域列表
export const getRegion = (data) =>
  request.get('/api/vm-service/region/search', {
    params: {
      ...data
    }
  })
// 新增区域
export const postRegion = (data) =>
  request.post('/api/vm-service/region', { ...data })

// 删除区域
export const delRegion = id => request.delete(`/api/vm-service/region/${id}`)
// 获取区域详情
export const getRegionFn = id => request.get(`/api/vm-service/region/${id}`)
// 点位
export const getNode = (data) => request.get('/api/vm-service/node/search', {
  params: {
    ...data
  }
})
// 删除点位
export const delNode = id => request.delete(`/api/vm-service/node/${id}`)
// 新建点位
export const addNode = data => request.post('/api/vm-service/node', data)
// 所属商圈
export const getPartner = () => request.get('/api/vm-service/businessType')
// 归属合作商
export const getNodeCollect = () => request.get('/api/vm-service/node/nodeCollect')
// 修改点位
export const changeNode = id => request.put(`/api/vm-service/node/${id.id}`, {
  ...id
})
// 搜索
export const searchNode = data => request.get('/api/vm-service/node/search', {
  params: {
    ...data
  }
})
// 合作商列表
export const getServer = data => request.get('/api/user-service/partner/search', {
  params: {
    ...data
  }
})
// 新增合作商
export const postServe = data => request.post('/api/user-service/partner', {
  ...data
})
// 删除合作商
export const delServe = id => request.delete(`/api/user-service/partner/${id}`)
// 修改合作商
export const changeServe = id => request.put(`/api/user-service/partner/${id.id}`, {
  ...id
})
// 重置密码
export const resetServe = id => request.put(`/api/user-service/partner/resetPwd/${id}`)
// 合作商搜索
export const searchServe = id => request.get('/api/user-service/partner/search', {
  params: {
    ...id
  }
})
